﻿namespace PlaylistCopy.Converters
{
    using System;
    using System.Globalization;
    using System.Windows;
    using System.Windows.Data;

    public class EnumToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object param, CultureInfo culture)
        {
            return value.Equals(param) ? Visibility.Visible : Visibility.Collapsed;
        }

        public object ConvertBack(object value, Type targetType, object param, CultureInfo culture)
        {
            return (Visibility) value == Visibility.Visible ? param : Binding.DoNothing;
        }
    }
}
